package com.sky.mapper;


import com.github.pagehelper.Page;
import com.sky.annotation.Autofill;
import com.sky.dto.CategoryPageQueryDTO;
import com.sky.entity.Category;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CategoryMapper {

    /*
     * 修改分类
     *
     */
    @Autofill(value = OperationType.UPDATE)
    void update(Category category);

    //查询
    Page<Category> select(CategoryPageQueryDTO categoryPageQueryDTO);
//添加员工
    @Autofill(value = OperationType.INSERT)
    void add(Category category);
    //删除分类
@Delete("delete from sky_take_out.category where id=#{id}")
    void getByID(Long id);

    /**
     * 根据类型查询分类
     * @param type
     * @return
     */
    List<Category> list(Integer type);
}




